
import { RouteRecordRaw } from "vue-router"
import Layouts from '../layouts/index.vue'
// import { RoleEnum } from '../enums/Role'

export const menuClassification: {id: number, title: string, icon: string}[] = [
  {
    id: 1,
    title: '房源管理',
    icon: 'House'
  },
  {
    id: 2,
    title: '用户管理',
    icon: 'User'
  },
  {
    id: 3,
    title: '系统管理',
    icon: 'Setting'
  }
]

//定义扩展RouteMeta字段
declare module 'vue-router' {
  interface RouteMeta {
    title: string
    clsId?: number
    isAuth: boolean
  }
}
export const frameIn: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Layouts',
    redirect: '/home',
    component: Layouts,
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('../views/home/index.vue'),
        meta: {
          title: '首页',
          isAuth: true
        }
      },
      {
        path: '/houseAdmin',
        name: 'HouseAdmin',
        component: () => import('../views/houseAdmin/index.vue'),
        meta: {
          title: '查看房源',
          clsId: 1,
          isAuth: true
        }
      },
      {
        path: '/delegateProcessing',
        name: 'DelegateProcessing',
        component: () => import('../views/delegateProcessing/index.vue'),
        meta: {
          title: '委托处理',
          clsId: 1,
          isAuth: true
        }
      },
      {
        path: '/verRecordAdmin',
        name: 'VerRecordAdmin',
        component: () => import('../views/verRecordAdmin/index.vue'),
        meta: {
          title: '核销管理',
          clsId: 1,
          isAuth: true
        }
      },
      // {
      //   path: '/landLordAdmin',
      //   name: 'LandLordAdmin',
      //   component: () => import('../views/landLordAdmin/index.vue'),
      //   meta: {
      //     title: '房东管理',
      //     clsId: 2,
      //     isAuth: true
      //   }
      // },
      // {
      //   path: '/brokerAdmin',
      //   name: 'BrokerAdmin',
      //   component: () => import('../views/brokerAdmin/index.vue'),
      //   meta: {
      //     title: '经纪人管理',
      //     clsId: 2,
      //     isAuth: true
      //   }
      // },
      {
        path: '/dictAdmin',
        name: 'DictAdmin',
        component: () => import('../views/dictAdmin/index.vue'),
        meta: {
          title: '字典管理',
          clsId: 3,
          isAuth: true
        }
      },
      {
        path: '/dictItemAdmin/:id',
        name: 'DictItemAdmin',
        component: () => import('../views/dictItemAdmin/index.vue'),
        meta: {
          title: '字典属性管理',
          isAuth: true
        }
      },
      {
        path: '/bannerAdmin',
        name: 'BannerAdmin',
        component: () => import('../views/bannerAdmin/index.vue'),
        meta: {
          title: '轮播图管理',
          isAuth: true,
          clsId: 3
        }
      },
      {
        path: '/userAdmin',
        name: 'UserAdmin',
        component: () => import('../views/userAdmin/index.vue'),
        meta: {
          title: '用户管理',
          isAuth: true,
          clsId: 2
        }
      },
      {
        path: '/signing',
        name: 'Signing',
        component: () => import('../views/signing/index.vue'),
        meta: {
          title: '签约',
          isAuth: true,
          clsId: 2
        }
      },
      {
        path: '/customerAdmin',
        name: 'CustomerAdmin',
        component: () => import('../views/customerAdmin/index.vue'),
        meta: {
          title: '客服管理',
          isAuth: true,
          clsId: 3
        }
      },
      {
        path: '/changePass',
        name: 'ChangePass',
        component: () => import('../views/changePass/index.vue'),
        meta: {
          title: '修改密码',
          isAuth: true,
          clsId: 3
        }
      }
    ]
  }
]

export const frameOut: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/index.vue')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('../views/404/index.vue')
  }
]

export default [
  ...frameIn,
  ...frameOut
]
